package com.yipinhouse.employee.client;

import com.yipinhouse.common.result.Result;
import com.yipinhouse.employee.client.param.LoginParam;
import com.yipinhouse.employee.client.result.PromotionResultInfo;
import com.yipinhouse.employee.client.result.BrokerInfoResult;
import com.yipinhouse.employee.client.result.ShopBrokerInfoResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "brokerInfoQueryClient",name="employee")
public interface BrokerInfoQueryClient {

    /**
     * 员工登录信息验证
     * @param param
     * @return
     */
    @PostMapping("login")
    public Result login(@RequestBody LoginParam param);

    /**
     * 获取员工个人信息
     * @param brokerId
     * @return
     */
    @GetMapping("getBrokerInfo")
    Result<BrokerInfoResult> getBrokerInfo(@RequestParam("brokerId") Integer brokerId);

    /**
     * 升职，获取员工信息,修改员工职位
     * @param brokerId
     * @return
     */
    @GetMapping("promotion")
    Result<PromotionResultInfo> promotion(@RequestParam("brokerId") Integer brokerId,
                                          @RequestParam("shopId") Integer shopId);
}
